/************************************************************************/
/*    Author: Scott Bevin                                               */
/************************************************************************/

#pragma once

#include <map>
#include <string>

namespace XF
{
	class GameEntity;
	class EntityComponentMakerBase;
	class EntityComponent;

	/**
		Factory to create agent components
		@author Scott Bevin
		*/
	class EntityComponentFactory
	{
	private:
		/**
			Returns the map which holds all the makers
			*/
		static std::map<std::string, EntityComponentMakerBase*>* MakersList();

	public:
		EntityComponentFactory();
		~EntityComponentFactory();

		/**
			Registers a maker into the list
			*/
		static void RegisterMaker(std::string id, EntityComponentMakerBase* maker);

		/**
			Unregisters a maker form the list
			*/
		static void UnregisterMaker(std::string id);

		/**
			Gets the correct maker and uses it to create a new EntityComponent
			*/
		static EntityComponent* CreateComponent(std::string id, GameEntity* owner);
	};
}
